package com.quxian.chambercommerce.dao.impl;

import java.util.List;
import java.util.Map;

import com.quxian.chambercommerce.base.BaseDaoSupport;
import com.quxian.chambercommerce.bean.TypeGroupEntity;
import com.quxian.chambercommerce.bean.TypeItemEntity;
import com.quxian.chambercommerce.dao.TypeManageDao;

public class TypeManageDaoImpl extends BaseDaoSupport implements TypeManageDao {

	@SuppressWarnings("unchecked")
	@Override
	public List<TypeGroupEntity> getAllType() {
		return this.getSqlMapClientTemplate().queryForList("TypeGroup.getAllType");
	}

	@Override
	public void deleteGroupById(Integer id) {
		this.getSqlMapClientTemplate().delete("TypeGroup.deleteGroupById", id);
	}

	@SuppressWarnings("unchecked")
	@Override
	public List<TypeItemEntity> selectItemByGroup(Integer groupId) {
		return this.getSqlMapClientTemplate().queryForList("TypeItem.selectItemByGroup", groupId);
	}

	@Override
	public void insterItem(TypeItemEntity entity) {
		this.getSqlMapClientTemplate().insert("TypeItem.insterItem", entity);
	}

	@Override
	public void deleteItemByGroup(Integer groupId) {
		this.getSqlMapClientTemplate().delete("TypeItem.deleteItemByGroup", groupId);
	}

	@Override
	public void deleteItemById(Integer id) {
		this.getSqlMapClientTemplate().delete("TypeItem.deleteItemById", id);
	}

	@Override
	public void updateTypeItem(Map<String, Object> map) {
		this.getSqlMapClientTemplate().update("TypeItem.updateTypeItem", map);
	}

}
